import requests from './ajax';


//用户登录接口  /login  get 有参数
export const reqUserLogin = (data) => requests({ url: `/login?userName=${data.userName}&password=${data.password}`, method: 'get' })

//注册 用户  get /register 有参数
export const reqUserRegister = (data) => requests({ url: `/login?userName=${data.userName}&password=${data.password}`, method: 'get' })

//获取一级分类 get /getTypeOne
export const reqTypeOne = () => requests({ url: '/getTypeOne', method: 'get' })

//获取轮阔图数据 get /banner
export const reqBanner = () => requests({ url: '/banner', method: 'get' })

//获取所有商品列表数据 get /goodList
export const reqAllGoodsList = () => requests({ url: '/goodList' })

//根据二级列表 /getTypeTwo get 有参数
export const reqTypeTwoList = (type_one) => requests({ url: `/getTypeTwo?type_one=${type_one}`, method: 'get' })

//获取二级商品列表
export const reqTypeTwoDataList = (type_one, type_two) => requests({ url: `/getTypeTwoList?type_one=${type_one}&type_two=${type_two}`, method: 'get' })

//根据word检索商品数据 /search get 有参数
export const reqSearchList = (word) => requests({ url: `/search?word=${word}` })

//根据id获取详情  /detail get 有参数
export const reqDetailById = (goodId) => requests({ url: `/detail?goodId=${goodId}`, method: 'get' })

//获取同店商品推荐列表 /saneList get 有参数
export const reqSameList = (supplier) => requests({ url: `/sameList?supplier=${supplier}&page=1`, method: 'get' })

//添加购物车 /add get 有参数
export const reqAddShopCard = (token, id) => requests({ url: `/add?token=${token}&goodId=${id}`, method: 'get' })

//获取购物车列表  /shopList get 有参数
export const reqShopList = (token) => requests({ url: `/shopList?token=${token}`, method: 'get' })

//加减商品的个数 /remove
export const reqChangeCount = (token, goodId, count) => requests({ url: `/remove?token=${token}&goodId=${goodId}&count=${count}`, method: 'get' })

//删除购物车
export const reqDeleteShopCard = (token, goodId) => requests({ url: `/del?token=${token}&goodId=${goodId}`, method: 'get' })

